home *** CD-ROM | disk | FTP | other *** search
- var pEnergy;
- var pTeaTime;
- var pBonus;
- var pBonusAnim;
- this.setHint = function(str)
- {
- this.hint_txt.text = str;
- };
- this.addScore = function(num)
- {
- _global.gSC += num;
- this.score_mc.setNum(_global.gSC);
- };
- this.teaBreak = function()
- {
- var _loc2_ = this;
- _loc2_._parent.snd_mc.playsound("pKettle");
- pTeaTime = 1;
- var _loc1_ = 0;
- while(_loc1_ < 5)
- {
- _loc2_._parent["cowboy" + _loc1_ + "_mc"].teaBreak();
- _loc1_ = _loc1_ + 1;
- }
- };
- this.teaBreakOver = function()
- {
- pTeaTime = 0;
- };
- this.decreaseEnergy = function(tx)
- {
- pEnergy -= tx;
- if(pEnergy <= 0)
- {
- pEnergy = 0;
- this._parent.gameOver("lose");
- }
- this.energybar_mc.gotoAndStop(pEnergy + 5);
- };
- this.increaseEnergy = function(tx)
- {
- pEnergy += tx;
- if(pEnergy >= 100)
- {
- pEnergy = 100;
- }
- this.energybar_mc.gotoAndStop(pEnergy + 5);
- };
- this.onEnterFrame = function()
- {
- pBonusAnim[0] = pBonusAnim[0] + 1;
- if(pBonusAnim[0] == 3)
- {
- pBonus--;
- pBonusAnim[1] = pBonusAnim[1] + 1;
- pBonusAnim[0] = 0;
- if(pBonusAnim[1] == 10)
- {
- if(pBonus < 0)
- {
- pBonus = 0;
- this.blurnum_mc._y = -50;
- }
- this.timer_mc.setNum(pBonus + "00");
- pBonusAnim[1] = 0;
- }
- }
- };
- this.addTarget = function()
- {
- var _loc2_ = this;
- var _loc3_ = Math.floor(Math.random() * 99);
- var _loc1_ = pBonus * 100 + _loc3_;
- _loc2_.addScore(_loc1_);
- pBonus = 1000;
- pBonusAnim[0] = 0;
- pBonusAnim[1] = 0;
- _loc2_.timer_mc.setNum("99900");
- _loc2_.blurnum_mc._y = 4;
- };
- this.init = function()
- {
- var _loc1_ = this;
- _global.gSC = 0;
- _loc1_.pEnergy = 100;
- _loc1_.pTeaTime = 0;
- _loc1_.pBonus = 1000;
- _loc1_.pBonusAnim = Array(0,0);
- };
- this.init();
-